package kr.or.kosta.otr.persistence.trueorfalse;
import java.sql.SQLException;
import java.util.HashMap;

import javax.annotation.Resource;

import kr.or.kosta.otr.vo.TrueOrFalseVO;

import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

@Repository("TrueOrFalseDao")
public class TrueOrFalseDaoImpl implements TrueOrFalseDao {
	@Resource(name="sqlMapClient")
	private SqlMapClient sqlMapClient;

	
	@Override
	public void increaseTruth(HashMap<String, Object> map) throws SQLException {
		sqlMapClient.update("TrueOrFalse.increaseTruth", map);
	}

	@Override
	public void increaseObjection(HashMap<String, Object> map)
			throws SQLException {
		sqlMapClient.update("TrueOrFalse.increaseObjection", map);
	}

	@Override
	public TrueOrFalseVO getTrueOrFalse(int companyReviewVerifyId)
			throws SQLException {
		return (TrueOrFalseVO)sqlMapClient.queryForObject("TrueOrFalse.getTrueOrFalse", companyReviewVerifyId);
	}

	@Override
	public void insertTruthOrFalse(int companyRevicewVerifyId)
			throws SQLException {
		// TODO Auto-generated method stub
		sqlMapClient.insert("TrueOrFalse.insertTruthOrFalse",companyRevicewVerifyId);
	}

	@Override
	public String getOneTruthByReviewVerifyId(int companyRevicewVerifyId)
			throws SQLException {
		// TODO Auto-generated method stub
		return (String)sqlMapClient.queryForObject("TrueOrFalse.getOneTruthByReviewVerifyId", companyRevicewVerifyId);
	}

	@Override
	public String getOneObjectionByReviewVerifyId(int companyRevicewVerifyId)
			throws SQLException {
		// TODO Auto-generated method stub
		return (String)sqlMapClient.queryForObject("TrueOrFalse.getOneObjectionByReviewVerifyId", companyRevicewVerifyId);
	}

}
